#version 330 core
out vec4 FragColor;
in vec3 Normal;
in vec3 FragPos;
in vec2 TexCoords;


struct Light {
    //vec3 position;
    vec3 direction;
    vec3 ambient;
    vec3 diffuse;
    vec3 specular;
};

uniform Light light;
uniform vec3 viewPos;

struct Material {
        vec3 baseColor;
        float metallic;
        float roughness;
};
uniform Material material;

void main()
{
    FragColor = vec4(1.0, 0.0, 0.0, 1.0);
#if 0
    vec3 diffuseTexColor = material.baseColor;
    vec3 specularTexColor = material.baseColor;
    // ambient
    vec3 ambient = light.ambient * diffuseTexColor;
    // diffuse
    vec3 norm = normalize(Normal);
    vec3 lightDir = normalize(-light.direction);
    float diff = max(dot(norm, lightDir), 0.0);
    vec3 diffuse = diff * light.diffuse * diffuseTexColor;
    // specular
    vec3 viewDir = normalize(viewPos - FragPos);
    vec3 reflectDir = reflect(-lightDir, norm);
    float spec = pow(max(dot(viewDir, reflectDir), 0.0), material.shininess);
    vec3 specular = spec * light.specular * specularTexColor;

    vec3 result = (ambient + diffuse + specular);
    FragColor = vec4(result, 1.0);
#endif

}
